package suanfa

import (
	"fmt"
	"unicode/utf8"
)
func stringNew() {
	s := "我爱慕课网！"
	for i, c := range s {
		fmt.Printf("%d\t%X\n", i, c)
	}
	fmt.Println("Rune count:",utf8.RuneCountInString(s))
	bytes := []byte(s)
	for len(bytes) > 0 {
		ch, size := utf8.DecodeRune(bytes)
		bytes = bytes[size:]
		fmt.Printf("%c\n", ch)
	}
	
	for j, chs := range []rune(s) {
		fmt.Printf("(%d %c)", j, chs)
	}

}
